package com.issac.demo.pooled2.mypool;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.UUID;
import java.util.concurrent.TimeUnit;

/**
 * @author: ywy
 * @date: 2023-06-28
 * @desc:
 */
@Data
@AllArgsConstructor
public class ShareBike {
    private String id;
    private String type;

    /**
     * 模拟new的耗时操作
     * @return
     */
    public static ShareBike init() {
        try {
            TimeUnit.MILLISECONDS.sleep(50);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return new ShareBike(UUID.randomUUID().toString().replace("-",""),"hello");
    }
}
